#include "StdAfx.h"
#include "dmGridCtrl.h"

#define ID_SCROLL_VERT	2
#define ID_SCROLL_HORZ	3
CdmGridCtrl::CdmGridCtrl(void)
{
}

CdmGridCtrl::~CdmGridCtrl(void)
{
}
void CdmGridCtrl::Init()
{
	CRect rectDummy;
	rectDummy.SetRectEmpty ();

	if (globalData.m_hcurStretch == NULL)
	{
		globalData.m_hcurStretch = AfxGetApp ()->LoadCursor (AFX_IDC_HSPLITBAR);
	}

	if (globalData.m_hcurStretchVert == NULL)
	{
		globalData.m_hcurStretchVert = AfxGetApp ()->LoadCursor (AFX_IDC_VSPLITBAR);
	}

	/*if (m_hcurDeleteColumn == NULL)
	{
	CBCGPLocalResource locaRes;
	m_hcurDeleteColumn = AfxGetApp ()->LoadCursor (IDC_BCGBARRES_DELETE_COLUMN);
	}

	if (m_hcurNoDropColumn == NULL)
	{
	m_hcurNoDropColumn = AfxGetApp ()->LoadCursor (AFX_IDC_NODROPCRSR);
	}*/

	InitColors ();

	m_Columns.SetOwnerList (this);

	m_wndScrollVert.Create (WS_CHILD | WS_VISIBLE | SBS_VERT, rectDummy, this, ID_SCROLL_VERT);
	m_wndScrollHorz.Create (WS_CHILD | WS_VISIBLE | SBS_HORZ, rectDummy, this, ID_SCROLL_HORZ);

	CString strName = ::AfxRegisterWndClass (
		CS_SAVEBITS,
		::LoadCursor(NULL, IDC_ARROW),
		(HBRUSH)(COLOR_BTNFACE + 1));
	m_ToolTip.Create (this);
	m_ToolTip.CreateEx(0,
		strName, _T (""), WS_POPUP,
		0, 0, 0, 0,
		this->GetSafeHwnd (), (HMENU) NULL);

	CWnd* pWndParent = GetParent ();
	m_bControlBarColors = pWndParent == NULL ||
		!pWndParent->IsKindOf (RUNTIME_CLASS (CDialog));

	AdjustLayout ();
	UpdateFonts ();
	CalcEditMargin ();
}
